package com.usian.common.interceptor;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * @author xiaowanmate
 * @date 2023/2/21 19:05
 */
//配置器（WebMvcConfigurer）全局拦截器实现类
@Component
public class WebMvcCofigSon implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // addPathPatterns("/**") 表示对所有请求都拦截
       registry.addInterceptor(new ServiceInterceptor()).addPathPatterns("/**");
    }
}
